//
//  ZJSCQusetionsSrectionModel.m
//  LovingPartyBuilding
//
//  Created by ZJ on 2017/5/6.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "ZJSCQusetionsSrectionModel.h"
#import "NSString+QT.h"
@implementation ZJSCQusetionsSrectionModel

- (NSString *)description{
    return [self yy_modelDescription];
}


- (NSMutableArray *)childModelArray{
    if (!_childModelArray) {
        _childModelArray = [[NSArray yy_modelArrayWithClass:[ZJSCQusetionsCellModel class] json:self.CHILD_CLASS_FAQ] mutableCopy];
    }
    return _childModelArray;
}


- (CGFloat)sectionHeight{
    //文字内容高度
    CGFloat contentH = [self.CONTENT getLabelSizeWithLabelFont:[UIFont titleTextFont] labelWidth:[UIScreen zj_screenWith] - 73 * [UIScreen zj_screenWScale] labelNumberOfLines:0 labelLineSpace:4 * [UIScreen zj_screenWScale] labelCharacterSpace:1];
    if (self.CHILD_CLASS_FAQ.count == 0) {//没有评论
        return (15 + 42 + 10 + 17) * [UIScreen zj_screenHScale] + contentH + 1;
    }else{//有评论

        
        return (15 + 42 + 10 + 8) * [UIScreen zj_screenHScale] + contentH ;
    }
}

@end



@implementation ZJSCQusetionsCellModel

- (NSString *)description{
    return [self yy_modelDescription];
}

- (CGFloat)cellHeight{
    
    NSString *contentText = [NSString stringWithFormat:@"%@ :%@",self.USER_NAME,self.CONTENT];

    CGFloat contentLabelH = [contentText getLabelSizeWithLabelFont:[UIFont titleTextFont] labelWidth:[UIScreen zj_screenWith] - (72 + 24) * [UIScreen zj_screenWScale] labelNumberOfLines:0 labelLineSpace:4 * [UIScreen zj_screenWScale] labelCharacterSpace:1];
    if (self.isLastCell) {//是最后一个cell
        
         return  (12  + 12 + 28 + 8) * [UIScreen zj_screenHScale]  + contentLabelH + 1;
        
    }else{//不是最后一个cell
    
        return  (12  + 28)  * [UIScreen zj_screenHScale]  + contentLabelH;
        
    }

}

@end
